import fetch from "./../fetch.js";

//获取权限菜单列表
const getMenuList = (params) => {
  return fetch({
    url: "/system/permissions/menuList",
    method: "post",
    data: JSON.stringify(params),
  });
};

//获取父级菜单列表
const getParentList = (params) => {
  return fetch({
    url: "/system/permissions/getParentList",
    method: "post",
    data: JSON.stringify(params),
  });
};

//添加菜单
const menuAdd = (params) => {
  return fetch({
    url: "/system/permissions/menuAdd",
    method: "post",
    data: JSON.stringify(params),
  });
};

//修改菜单
const menuUpdate = (params) => {
  return fetch({
    url: "/system/permissions/menuUpdate",
    method: "post",
    data: JSON.stringify(params),
  });
};

//删除菜单
const menuDelete = (params) => {
  return fetch({
    url: "/system/permissions/menuDelete",
    method: "post",
    data: JSON.stringify(params),
  });
};

export default {
  getMenuList,
  getParentList,
  menuAdd,
  menuUpdate,
  menuDelete
};
